import request from '@/utils/request'

/*
* 产品
*  */

export const retailProductListQuery = (params) => {
  return request({
    url: `/retailProduct/listQuery/listQuery?pageNum=${params.pageNum ? params.pageNum : 1}&pageSize=${params.pageSize ? params.pageSize : 10}&id=${params.id ? params.id : ''}&name=${params.name ? params.name : ''}`,
    method: 'get'
  })
}

export const retailProductList = (params) => {
  return request({
    url: `/retailProduct/list?id=${params.id ? param.id : ''}&name=${params.name ? params.name : ''}`,
    method: 'get'
  })
}

export const retailProductGetEntityById = (id) => {
  return request({
    url: `/retailProduct/getEntityById/${id}`,
    method: 'get'
  })
}
export const retailProductAdd = (data) => {
  return request({
    url: '/retailProduct/add',
    method: 'post',
    data
  })
}

export const retailProductUpdate = (data) => {
  return request({
    url: '/retailProduct/update',
    method: 'put',
    data
  })
}

export const retailProductRemove = (id) => {
  return request({
    url: `/retailProduct/delete?id=${id}`,
    method: 'delete'
  })
}
